<template>
  <div>
    <ul>
      <li><router-link to="/contacts/allcont">All_contacts</router-link></li>
      <li><router-link to="/contacts/alice">Alice</router-link></li>
      <li><router-link to="/contacts/bob">Bob</router-link></li>
    </ul>
    <button @click='rodum'>随机显示</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      url: ['allcont', 'alice', 'bob']
    }
  },
  methods: {
    rodum() {
      const rs = ~~(Math.random()*3)
      this.$router.push(this.url[rs])
    }
  }
}
</script>

<style>

</style>